<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;

class CreateCouponSettingTable extends Migration {

	/**
	 * Run the migrations.
	 *
	 * @return void
	 */
	public function up()
	{
		Schema::create('coupon_setting', function(Blueprint $table)
		{
			$table->integer('id', true);
			$table->integer('type')->nullable()->comment('0  用户关注类型 1 满足条件类型');
			$table->string('name', 200)->nullable();
			$table->integer('order_num')->nullable()->comment('推广的订单数');
			$table->decimal('money', 10)->nullable()->comment('推广的金额');
			$table->integer('coupon_id')->nullable()->comment('优惠券id');
			$table->dateTime('start_time')->nullable();
			$table->dateTime('end_time')->nullable();
			$table->integer('user_num')->nullable()->default(0)->comment('满足推广人数');
		});
	}


	/**
	 * Reverse the migrations.
	 *
	 * @return void
	 */
	public function down()
	{
		Schema::drop('coupon_setting');
	}

}
